package com.bluishoul.kittymeow.bean;

import java.sql.Timestamp;

import my.db.POJO;
import my.db.QueryHelper;

public class User  extends POJO{
	private static final long serialVersionUID = 1L;

	public static final int ROLE_ADMIN = 128;
	
	public User login(){
		String sql = "SELECT * FROM meow_user WHERE username = ? and pwd = ?";
		return QueryHelper.read(User.class, sql, username , pwd);
	}
	
	public User exists(){
		String sql = "SELECT * FROM meow_user WHERE username = ?";
		return QueryHelper.read(User.class, sql, username);
	}
	
	private long id;
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	public String getNickName() {
		return nickName;
	}
	public void setNickName(String nickName) {
		this.nickName = nickName;
	}
	public int getGender() {
		return gender;
	}
	public void setGender(int gender) {
		this.gender = gender;
	}
	public String getGravatar() {
		return gravatar;
	}
	public void setGravatar(String gravatar) {
		this.gravatar = gravatar;
	}
	public int getType() {
		return type;
	}
	public void setType(int type) {
		this.type = type;
	}
	public int getRole() {
		return role;
	}
	public void setRole(int role) {
		this.role = role;
	}
	public Timestamp getCreate_time() {
		return create_time;
	}
	public void setCreate_time(Timestamp create_time) {
		this.create_time = create_time;
	}
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String getPwd() {
		return pwd;
	}
	public void setPwd(String pwd) {
		this.pwd = pwd;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	
	@Override
	public String TableName(){
		return "meow_user";
	}
	
	private String nickName;
	private int gender;
	private String gravatar;
	private int type;
	private int role;
	private Timestamp create_time;
	private String username;
	private String pwd;
	private String email;
}
